export default {
  data () {
    return {
      qualityRectificationOption: {
        series: [{
          type: 'liquidFill',
          data: [0.6, 0.5],
          radius: '95%',
          // 水球颜色
          color: ['#136595', '#1fadff'],
          center: ['50%', '50%'],
          outline: {
            borderDistance: 2,
            itemStyle: {
              borderWidth: 2,
              borderColor: '#1fadff'
            }
          },
          label: {
            normal: {
              color: '#fff',
              insideColor: '#fff',
              fontSize: 14
            }
          },
          // 内图 背景色 边
          backgroundStyle: {
            color: 'rgba(4,24,74,0)'
          }
        }]
      }
    }
  },
  methods: {
    initQualityRectification () {
      const qualityNoChange = this.safetyculter.qualityNoChange
      const qualityChange = this.safetyculter.qualityChange
      const all = qualityChange + qualityNoChange
      if (all === 0) {
        this.qualityRectificationOption.series[0].data = [0, 0]
      } else {
        this.qualityRectificationOption.series[0].data = [qualityChange / all, qualityChange / all]
      }
      if (!this.qualityRectificationEchart) {
        this.qualityRectificationEchart = this.$echarts.init(this.$refs.qualityRectification)
        this.qualityRectificationEchart.setOption(this.qualityRectificationOption)
      }
    }
  }
}
